<?php
require_once 'conf/rdbms_viewer.conf.php';
require_once 'lib/extjs_services.class.php';
requirE_once 'lib/rdbms_viewer.class.php';

/* core rdbms connnectivity */
$options    =   array('dsns' =>  array('rdbms_viewer' => $conf['rdbms_dsn']));
$rdbms      =   new rdbms_viewer($options);
$dsn        =   $rdbms->fetch_dsn($_GET['dsn_id']);

/* generic data fetching / extjs services access */
$dsn['database']    =   (!isset($dsn['database']) || empty($dsn['database']) || is_null($dsn['database'])) ?
                        $_GET['database'] : $dsn['database'];

$options    =   array('dsn' =>  $dsn);
$extjs      =   new extjs_services($options);

echo $extjs->build_extjs_formpanel_items($_GET['table']);

//echo json_encode($response);

?>
